﻿using Mes.Domain.BoundedContext.Entities.Operations;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;

namespace Mes.Infrastructure.Data.BoundedContext.EntityTypeConfigurations.Operations
{
    public class BomItemOperStepLinkEntityConfig : IEntityTypeConfiguration<BomItemOperStepLink>
    {
        public void Configure(EntityTypeBuilder<BomItemOperStepLink> builder)
        {
            builder.ToTable("bom_item_oper_step_link");
            builder.HasKey(e => new { e.Parent_Item_Id, e.Ver_Id, e.Bom_Pos, e.Process_Id, e.Oper_Id, e.Step_No, e.Step_Grp_Id });
            builder.Property(e => e.Row_Id).IsRequired().UseIdentityColumn().HasIdentityOptions(startValue: 0, incrementBy: 1, minValue: 0);
        }
    }
}
